home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1993 / MacHack 1993.toast / MacHack™ 1987-1992 / MacHack™ '90 / Other Stuff / Demos ƒ / TOPS SoftTalk Package / MiniMacApp Headers / CApplication.h next >
Encoding:
C/C++ Source or Header  |  1989-09-06  |  2.4 KB  |  109 lines  |  [TEXT/MPS ]

  1. /*
  2. ------------------------------------------------------------------------------
  3. |    Sun Microsystems, TOPS Division
  4. |    950 Marina Village Parkway
  5. |    P.O. Box 4016
  6. |    Alameda, CA 94501
  7. |    
  8. |    Copyright (c) 1989 Sun Microsystems, Inc. All rights reserved.
  9. |    
  10. |    Sun considers its source code as an unpublished, proprietary trade secret,
  11. |    and it is available only under strict license provisions. This copyright
  12. |    notice is placed here only to protect Sun in the event the source is deemed
  13. |    a published work. Disassembly, decompilation, or other means of reducing the
  14. |    object code to human readable form is prohibited by the license agreement
  15. |    under which this code is provided to the user or company in possession of
  16. |    this copy.
  17. |    
  18. |    RESTRICTED RIGHTS LEGEND: Use, duplication, or disclosure by the Government
  19. |    is subject to restrictions as set forth in subparagraph (c) (1) (ii) of the
  20. |    Rights in Technical Data and Computer Software clause at DFARS 52.227-7013
  21. |    and in similar clauses in the FAR and NASA FAR supplement.
  22. ------------------------------------------------------------------------------
  23. */
  24.  
  25.  
  26.  
  27. /*
  28.  
  29.     INTERFACE CApplication
  30.  
  31. */
  32.  
  33. #ifndef    __CApplication__
  34. #define    __CApplication__
  35.  
  36.  
  37. #include "StdHdr.h"
  38. #include "CObject.h"
  39. #include <EventMgr.h>
  40.  
  41.  
  42. /***  CONSTANTS  ***/
  43.  
  44.     /* menu ids */
  45. #define    mApple    1
  46. #define    iAbout    1
  47.  
  48. #define    mFile    2
  49.  
  50. #define    mEdit    3
  51.  
  52.  
  53.     /* cmd numbers */
  54. #define    cNoCmd    0
  55. #define    cAbout    1
  56. #define    cOpenDA    2
  57.  
  58. #define    cQuit    10
  59. #define    cNew    11
  60. #define    cOpen    12
  61.  
  62. #define    kSFTop    50
  63. #define    kSFLeft    50
  64.  
  65. #define    kAboutAlertID    201
  66.  
  67.  
  68.  
  69. void InitToolbox(INT16 callsToMoreMasters);
  70.  
  71. struct CApplication:CObject {
  72.  
  73.     Boolean fDone;
  74.     OSType fMainFileType;
  75.     Boolean fWNE;
  76.  
  77.     /* initialization */
  78.     void IApplication(OSType itsMainFileType);
  79.     void CreateMenus(void);
  80.     void MainEventLoop(void);
  81.     
  82.     /* event dispatching */
  83.     void HandleEvent(EventRecord* e);
  84.     void DoUpdate(EventRecord* e);
  85.     void DoActivate(EventRecord* e);
  86.     void DoKeyDown(EventRecord* e);
  87.     void DoMouseDown(EventRecord* e);
  88.     void DoMouseMoved(EventRecord* e);
  89.     void DoResume(EventRecord* e);
  90.     void DoSuspend(EventRecord* e);
  91.     void DoIdle(EventRecord* e);
  92.     
  93.     /* menu handling */
  94.     void HandleMenuSelection(INT32 theSelection);
  95.     INT16 MenuSelectionToCmd(INT16 menu, INT16 item);
  96.     void DoMenuCmd(INT16 cmd);
  97.     
  98.     /* cmd number methods */
  99.     void DoAbout(void);
  100.     void OpenDA(INT16 whichOne);
  101.     void Quit(void);
  102.     void OpenNew(void);
  103.     void OpenOld(void);
  104.     void OpenFile(OSType fType, INT16 vRefNum, Str255 fName);
  105. };
  106.  
  107.  
  108. #endif
  109.